<!-- 特殊规则设置 -->
<template>
  <dt-modal-edit
    ref="edit"
    :title="title"
    :label-width="130"
    okText="确认"
    :width="600"
    @ok="onOk"></dt-modal-edit>
</template>

<script>
  import editMgr from '../opt/edit.js'
  import sopApi from '@/biz/buildingManagement/sopConfig'
  export default {
    components: {},
    data() {
      return {
        title: '特殊规则设置',
        info: {
          delayDay: null,
          ruleStartTime: null,
          ruleEndTime: null,
          sopName: '',
          configId: null
        }
      }
    },
    computed: {},
    watch: {},
    methods: {
      onOk() {
        let params = {
          ...this.info,
          level: 4,
          orgId: this.$dt.buildInfo().housesId
        }
        sopApi.editRule1(params).then((res) => {
          this.$Message.success('设置成功')
          this.$emit('success')
          this.hide()
          console.log(res)
        })
      },
      show(data) {
        this.info.sopName = data.sopName
        this.info.configId = data.id
        this.$refs.edit.show(editMgr.options(this), this.info)
      },
      hide() {
        this.$refs.edit.hide()
      }
    },
    created() {},
    mounted() {}
  }
</script>
<style lang="scss" scoped></style>
